package com.funcity.stage.elements
{
	import com.funcity.cache.ResourceCacher;
	import com.funcity.events.CacheEvent;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;

	public final class StageMasker extends Sprite
	{
		public function StageMasker(maskerUrl:String, xPos:Number, yPos:Number)
		{
			super();
			
			mouseEnabled = false;
			mouseChildren = false
			
			alpha = 0.6;
			x = xPos;
			y = yPos;
			
			//ResourceCacher.instance.addEventListener(maskerUrl, handleResource);
			//ResourceCacher.instance.loadMovieClip(maskerUrl);
		}
		
		private function handleResource(e:CacheEvent):void
		{
			e.stopImmediatePropagation();
			
			ResourceCacher.instance.removeEventListener(e.type, handleResource);
			addChild(MovieClip(e.data));
		}
	}
}